;====================================================================
;
; Ogre3D Wrapper for Blitz3D
;
; Ogre::Camera
;
;====================================================================

Function CreateCamera%(parent% = 0)
	ent.TEntity = New TEntity
	ogre_entity_count = ogre_entity_count + 1
	ent\ptr = o_createCamera(ogre3d\ogre_scenemanager, genEntityName("cam_"))
	ent\typ	= ET_CAMERA
	
	Local w# = GraphicsWidth()
	Local h# = GraphicsHeight()
	
	o_addViewPort(ogre3d\ogre_win, ent\ptr, 0, 0, 0, w, h)
	o_setAspectRatio(ent\ptr, w / h)
	
	ent\vport = o_camera_getViewPort(ent\ptr)
	
	If parent > 0 Then EntityParent(Handle(ent), parent)
	
	Return Handle(ent)
End Function

Function CameraRange(camera%, near#, far#)
	Local e.TEntity = Object.TEntity(camera)
	
	o_setNearClipDistance(e\ptr, near)
	o_setFarClipDistance(e\ptr, far)
End Function

Function CameraClsColor(camera%, red#, green#, blue#)
	Local e.TEntity = Object.TEntity(camera)
	
	o_setBackgroundColour(e\vport, red#, green#, blue#, 1.0)
End Function

Function ScreenFX(camera%, fx$)
	Local e.TEntity = Object.TEntity(camera)
	
	o_addCompositor(e\vport, fx$, -1)
	o_setCompositorEnabled(e\vport, fx$, True)
End Function

;~IDEal Editor Parameters:
;~C#Blitz3D